@function r($px) { 
    @return $px/40*1rem; //计算rem
}

//预设居中样式，条件是爸爸必须是relative
@mixin middle{
    position: absolute;
    top:50%;
    transform:translateY(-50%);
}

//上下左右居中
@mixin abCenter{
    position: absolute;
    top:-9999px;
    bottom:-9999px;
    left: -9999px;
    right:-9999px;
    margin: auto;
}

//图片居中
@mixin aImg{
    overflow: hidden;
    position: relative;
    img{
        position: absolute;
        width: 100%;
        top:-9999px;
        bottom:-9999px;
        left:-9999px;
        right:-9999px;
        margin: auto;
    }
}